//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "CImage.h"
#pragma package(smart_init)
//---------------------------------------------------------------------------
// ValidCtrCheck est utilisé est utilisé pour être sûr que les composants créés n'ont
// aucune fonction virtuelle pure.
//

static inline void ValidCtrCheck(CImage *)
{
    new CImage(NULL);
}
//---------------------------------------------------------------------------
__fastcall CImage::CImage(TComponent* Owner)
    : TImage(Owner)
{
    m_Images = NULL;
    m_ImageIndex = 0;
    m_Transparent = true;
    m_AutoSize = true;
    TImage::AutoSize = false;
}
//---------------------------------------------------------------------------
namespace Cimage
{
    void __fastcall PACKAGE Register()
    {
         TComponentClass classes[1] = {__classid(CImage)};
         RegisterComponents("EIC Ctrlstd", classes, 0);
    }
}
//---------------------------------------------------------------------------
void __fastcall CImage::Afficher(void)
{
    if (    m_Images
         && (m_ImageIndex >= 0)
         && (m_ImageIndex <= m_Images->Count)) {
        if (m_AutoSize) {
            Height = m_Images->Height;
            Width  = m_Images->Width;
        }
        TImage::Transparent = m_Transparent;
        m_Images->Draw(Canvas,0,0,m_ImageIndex,true);
        Repaint();
    }
}
//---------------------------------------------------------------------------

